<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order', function (Blueprint $table) {
            $table->increments('id');
            $table->string('type');//订单类型 团购订单 直接订单
            $table->string('group_sn',60)->nullable();//团购订单编号
            $table->string('order_sn',60);//订单编号
            $table->decimal('total_price');//订单总价
            $table->decimal('preferential_price');//优惠总价
            $table->decimal('present_price');//现总价
            $table->decimal('actual_pay');//实际支付
            $table->string('voucher_sn',60);//优惠券编号
            $table->integer('group_commander');//团长id
            $table->json('goods');//商品详情
            $table->json('addressee');//收件人详情
            $table->integer('staff_uuid');//下单人id
            $table->string('status',16);//订单状态
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order');
    }
}
